package cn.edu.xmist.singleton;

/**
 * 饿汉式单例模式
 */
public class Singleton2 {
    private static Singleton2 singleton2 =new Singleton2();//在第一次引用类的任何成员时创建实例

    private Singleton2() {
    }

    public static Singleton2 getSingleton2() {
        return singleton2;
    }
}
